<?php
//1.看有没有这个用户
//2.看密码对不对
$username = $_POST['Username'];
$password = $_POST['Password'];

$sql = 'select * from `account` where `Username`=\''.str_replace("''",'',$username).'\'';
$sqli = new mysqli('localhost','root','','myblog');
$rs = $sqli->query($sql);
$row = $rs->fetch_assoc();
if(!$row){
    echo "用户名未找到<br />";
}else{
    $passwordIndb = $row["Password"];
    if($passwordIndb!=$password){
        echo "密码错误<br />";
    }else{
        //密码验证成功
        setcookie("myId",$row["Id"]);
        echo "登录成功";
    }
}